package com.bzkj.basicinfo.mapper.putaway;

import com.bzkj.basicinfo.domain.putaway.WmsPutawayTaskEntity;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;

/**
 * 上架任务Mapper接口
 *
 *@author lixinyu
 * @date 2025-10-22
 */
public interface WmsPutawayTaskMapper {

    /**
     * 查询上架任务列表
     */
    List<WmsPutawayTaskEntity> selectPutawayTaskList(WmsPutawayTaskEntity entity);

    /**
     * 根据ID查询上架任务
     */
    WmsPutawayTaskEntity selectPutawayTaskById(@Param("id") Long id);

    /**
     * 根据任务号查询上架任务
     */
    WmsPutawayTaskEntity selectPutawayTaskByNo(@Param("putawayTaskNo") String putawayTaskNo);

    /**
     * 根据收货明细ID查询上架任务
     */
    List<WmsPutawayTaskEntity> selectPutawayTaskByReceiveDetailId(@Param("receiveDetailId") Long receiveDetailId);

    /**
     * 新增上架任务
     */
    int insertPutawayTask(WmsPutawayTaskEntity entity);

    /**
     * 批量新增上架任务
     */
    int insertPutawayTaskBatch(@Param("list") List<WmsPutawayTaskEntity> list);

    /**
     * 更新上架任务
     */
    int updatePutawayTask(WmsPutawayTaskEntity entity);

    /**
     * 删除上架任务
     */
    int deletePutawayTaskById(@Param("id") Long id);

    /**
     * 批量删除上架任务
     */
    int deletePutawayTaskByIds(@Param("ids") Long[] ids);

    /**
     * 更新任务状态
     */
    int updateTaskStatus(@Param("id") Long id,
                         @Param("taskStatus") String taskStatus,
                         @Param("updateBy") String updateBy);

    /**
     * 更新已上架数量
     */
    int updatePutedQuantity(@Param("id") Long id,
                           @Param("putedQuantity") BigDecimal putedQuantity);

    /**
     * 分配任务
     */
    int assignTask(@Param("id") Long id,
                   @Param("assignedTo") String assignedTo,
                   @Param("updateBy") String updateBy);

    /**
     * 更新实际储位
     */
    int updateActualLocation(@Param("id") Long id,
                            @Param("actualLocationId") String actualLocationId,
                            @Param("actualLocationCode") String actualLocationCode);
}
